package servlet;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class ReadText {
    public static void main(String[] args) {
        try {
            // 指定要读取的文件路径
            String filePath = "out/artifacts/WinterTourism_war_exploded/md/1704708919711.md";

            // 创建 FileReader 对象并传入文件路径作为参数
            FileReader reader = new FileReader(filePath);

            // 创建 BufferedReader 对象，将其包装到 FileReader 上
            BufferedReader bufferedReader = new BufferedReader(reader);

            // 逐行读取文件内容
            String line;
            while ((line = bufferedReader.readLine()) != null) {
                System.out.println(line);
            }

            // 关闭流
            bufferedReader.close();
            reader.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
